<?php

class Application_Form_Auth extends Zend_Form
{

    public function init()
    {
        $this->setName('auth_form');
        parent::init();
        
        $this->setMethod('POST');
        
        $login = new Zend_Form_Element_Text('login');
        $login->setLabel('Логин')
                ->setAttribs(array(
                    'placeholder' => 'Колдонуучу аты',
                    'id' => 'username'
                ))
                ->removeDecorator('Label')
                ->removeDecorator('HtmlTag')
                ->removeDecorator('DtDdWrapper')
                ->removeDecorator('Description')
                ->setRequired(true)
                ->addValidator('NotEmpty')
                ->addValidator('Alnum')
                ->setFilters(array('StringToLower'));
        $this->addElement($login);
        
        $password = new Zend_Form_Element_Password('password');
        $password->setLabel('Пароль')
                ->setAttribs(array(
                    'placeholder' => 'Сыр сөз',
                    'id' => 'password'
                ))
                ->removeDecorator('Label')
                ->removeDecorator('HtmlTag')
                ->removeDecorator('DtDdWrapper')
                ->removeDecorator('Description')
                ->setRequired(true)
                ->addValidator('NotEmpty');
        $this->addElement($password);
        
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Кирүү')
                ->removeDecorator('HtmlTag')
                ->removeDecorator('DtDdWrapper')
                ->removeDecorator('Description');
        $this->addElement($submit);
    }


}

